package ThreadDemo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-10-20
 * Time: 18:22
 */
//使用饿汉模式实现单例设计模式
//该模式在多线程环境下不会有线程安全问题
public class Singleton {
    private static Singleton Init = new Singleton();

    public static Singleton getInit(){
        return Init;
    }

    private Singleton(){

    }
}
